//Name:
//Purpose:
//Author: wjy
//Date: 2022-01-24 22:26:36
//From:
 
#include <stdio.h>
#include <stdlib.h>
 
int main(void)
{
    int flag = 1;
    float num;
    float max;
    while (1)
    {
        printf("Enter a number: ");
        scanf ("%f", &num);
        if (flag == 1)
        {
            max = num;
            flag++;
        }
        else
        {
            if (num < 0 || num == 0)
            {
                break;
            }
            else
            {
                if (num > max)
                {
                    max = num;
                }
            }
        }
        
    }
    printf ("The largest number entered was %f",max);
    system("pause");
    return 0;
}